package com.itawei.d5_threadsafe;

/**
 * 同步代码块：解决线程安全问题
 * 电影院3个窗口 卖100张票
 */
public class ThreadSafeDemo1 {
    public static void main(String[] args) {
        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        MyThread t3 = new MyThread();

        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");
        t1.start();
        t2.start();
        t3.start();
    }
}
